package edu.cornell.cubooks.dao;

import java.util.List;
import java.util.Set;

/**
 * Generic Data Access Object Interface which defines CRUD operations
 * common for other DAOs.
 * 
 * @author CUBooks Team
 *
 * @param <DomainObject> the domain object type
 * @param <KeyType> the primary key type for domain object
 */
public interface GenericDao <DomainObject, KeyType> {

    public DomainObject load(KeyType id);
    public DomainObject get(KeyType id);
    public void update(DomainObject object);
    public DomainObject save(DomainObject object);
    public void delete(DomainObject object);
    public void deleteById(KeyType id);
    public Set<DomainObject> getAll();
    public int count();
    public Set<DomainObject> toSet(List<DomainObject> list);
	
}
